package com.kaigejava.guanchazhemoshi.javaobserver;

import java.util.Observable;
import java.util.Observer;

/**
 * Created by kaigejava on 2019/8/12.
 */
public class CurrentConditionJava implements Observer {
    private float mTemperatrue;
    private float mPressure;
    private float mHumidity;
    @Override
    public void update(Observable o, Object arg) {
        this.mTemperatrue=((DataParam)(arg)).mTemperatrue;
        this.mPressure=((DataParam)(arg)).mPressure;
        this.mHumidity=((DataParam)(arg)).mHumidity;
        display();
    }
    public void display()
    {
        System.out.println("***Today mTemperatrue:" +mTemperatrue+"***");
        System.out.println("***Today mPressure:" +mPressure+"***");
        System.out.println("***Today mHumidity:" +mHumidity+"***");
    }
}
